package com.dogstudio.mygame.base;

import com.dogstudio.mygame.config.Config;
import com.dogstudio.mygame.utils.LogUtils;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.resolutionpolicy.FixedResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.ui.activity.BaseGameActivity;

/**
 * 游戏界面基类
 */

public class BaseGame extends BaseGameActivity {
    private String tag = this.getClass().getSimpleName();
    private Camera mCamera = new Camera(0, 0, Config.SCREEN_WIDTH, Config.SCREEN_HEIGHT);
    protected Engine mEngine;

    @Override
    public Engine onLoadEngine() {
        LogUtils.e(tag, "onLoadEngine");
        EngineOptions option = new EngineOptions(true, EngineOptions.ScreenOrientation.PORTRAIT, new FixedResolutionPolicy(Config.SCREEN_WIDTH, Config.SCREEN_HEIGHT), mCamera);
        mEngine = new Engine(option);
        return mEngine;
    }

    @Override
    public void onLoadResources() {
        LogUtils.e(tag, "onLoadResources");
    }

    @Override
    public Scene onLoadScene() {
        LogUtils.e(tag, "onLoadScene");
        return null;
    }

    @Override
    public void onLoadComplete() {
        LogUtils.e(tag, "onLoadComplete");
    }

    @Override
    public void onPauseGame() {
        super.onPauseGame();
        LogUtils.e(tag, "onPauseGame");
    }

    @Override
    public void onResumeGame() {
        super.onResumeGame();
        LogUtils.e(tag, "onResumeGame");
    }
}
